js_log( "init mvBaseUploadInterface:: " + this.api_url);
},
setupForm:function(){
+ js_log("Base::setupForm::");
var _this = this;
//set up the local pointer to the edit form:
- _this.editForm = _this.getEditForm();
+ _this.editForm = _this.getEditForm();
if( _this.editForm ){
-
+
//if in api re-map the upload form to api: (we have to do this BEFORE the users selects a file)
- if(_this.upload_mode == 'api'){
+ if( _this.upload_mode == 'api'){
_this.doRemapFormToApi();
- }
+ }
//set up the org_onsubmit if not set:
if( typeof( _this.org_onsubmit ) == 'undefined' && _this.editForm.onsubmit )
- _this.org_onsubmit = _this.editForm.onsubmit;
-
+ _this.org_onsubmit = _this.editForm.onsubmit;
+
+
//set up the submit action:
$j( _this.editForm ).submit( function(){
js_log('setupForm.onSubmit:');
-
+
//set the upload mode:
_this.setWgUploadSelect();
}
//put into a try catch so we are sure to return false:
try{
+ debugger;
//get a clean loader:
_this.dispProgressOverlay();
//don't submit the form we will do the post in ajax
return false;
});
- }
-
+ }
+ $j('#testcat').click(function(){
+ $j( _this.editForm ).submit();
+ });
},
detectUploadMode:function( callback ){
var _this = this;
return false;
//add the action api
- $j(_this.editForm).attr('action', _this.api_url);
+ //$j(_this.editForm).attr('action', _this.api_url);
//add api url
//add api action:
$j(_this.editForm).find("[name='wpEditToken']").attr('name', 'token');
$j(_this.editForm).find("[name='wpIgnoreWarning']").attr('name', 'ignorewarnings');
$j(_this.editForm).find("[name='wpWatchthis']").attr('name', 'watch');
-
- //update the status to 100% progress bar (no status in iframe submit)
- $j('#up-progressbar' ).progressbar( 'value', parseInt( 100 ) );
- $j('#up-status-container').html( gM('mwe-upload-in-progress') );
+
},
setWgUploadSelect: function(){
if( $j('#wpSourceTypeFile').length == 0 || $j('#wpSourceTypeFile').get(0).checked ){
this.http_copy_upload = false;
- }else if( $j('#wpSourceTypeURL').get(0).checked ){
+ }else if( $j('#wpSourceTypeUrl').get(0).checked ){
this.http_copy_upload = true;
}
},
return false;
}else if( _this.upload_mode == 'api' ){
js_log('doHttpUpload (no form submit) ');
-
//if the api is supported.. && source type is http do upload with http status updates
var httpUpConf ={
'url' : $j('#wpUploadFileURL').val(),
//hide all targets:
var hide_target_list='';
var coma='';
- $j.each(default_firefogg_options, function(target, na){
+ $j.each( default_firefogg_options, function(target, na) {
if(target.substring(0, 6)=='target'){
hide_target_list+=coma + _this[target];
coma=',';
});
$j( hide_target_list ).hide();
//now that the proper set of items has been hiiden show:
- $j( this.selector ).show();
+ $j( _this.selector ).show();
//hide all but check-for-fogg
//if rewriting the form lets keep the text input around:
if( _this.form_rewrite )
- $j(this.target_input_file_name).show();
+ $j( _this.target_input_file_name ).show();
//show select file:
$j( this.target_btn_select_file ).unbind(
return gM('mwe-upload-transcode-in-progress');
},
doUploadSwitch:function(){
- var _this = this;
+ var _this = this;
js_log("firefogg: doUploadSwitch:: " + this.fogg_enabled + ' up mode:' + _this.upload_mode);
//make sure firefogg is enabled otherwise do parent UploadSwich:
if( !this.fogg_enabled || !this.firefogg_form_action )
loadGM({
- "mwe-select_transcript_set" : "Select layers",
+ "mwe-select_transcript_set" : "Select subtitles",
"mwe-auto_scroll" : "auto scroll",
"mwe-close" : "close",
"mwe-improve_transcript" : "Improve",
- "mwe-no_text_tracks_found" : "No text tracks were found",
- "mwe-subtitles" : "$1 subtitles"
+ "mwe-no_text_tracks_found" : "No text tracks were found"
})
// text interface object (for inline display captions)
var mvTextInterface = function( parentEmbed ){
'category' : 'SUB',
'lang' : langKey,
'type' : mimeTypes[ extension ],
- 'title' : gM('mwe-subtitles', langData[ langKey]),
+ 'title' : langData[ langKey],
'src' : wgServer + wgScript + '?title=' + subPage.title + '&action=raw'
});
_this.pe.media_element.tryAddSource( textElm );